﻿using Stylet;
using Stylet.Logging;
using StyletIoC;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WinsionApp.Modules;
using WinsionApp.Pages;
using WinsionApp.Services;

namespace WinsionApp
{
    public class Bootstrapper : Bootstrapper<SplashViewModel>
    {
        protected override void ConfigureIoC(IStyletIoCBuilder builder)
        {
            // Configure the IoC container in here
            base.ConfigureIoC(builder);

            builder.Bind<IViewFactory>().ToAbstractFactory();

            // 注册其他服务
            builder.Bind<ILogger>().To<LoggerService>().InSingletonScope();
            builder.Bind<ILogService>().To<LogService>().InSingletonScope();

            // 添加模块
            builder.AddModule(new ServiceModule());
            builder.AddModule(new FeatureSetModule());
        }

        protected override void Configure()
        {
            // Perform any other configuration before the application starts
        }

        protected override void OnStart()
        {
            // base.OnStart();
            
            Stylet.Logging.LogManager.Enabled = true;
        }
    }
}
